import { Navigate } from "react-router-dom";
import About from "../pages/About";
import Description from "../pages/Description";
import Home from "../pages/Home";
import Message from "../pages/Message";
import News from "../pages/News";
import TestQuery from "../pages/TestQuery";
import TestState from "../pages/TestState";

export default [
    {
        path:'/about',
        element: <About/>
    },
    {
        path:'/home',
        element:<Home/>,
        children:[
            {
                path:'message',
                element:<Message/>,
                children:[
                    {
                        path:'description/:id/:title',
                        element:<Description/>
                    },
                    {
                        path:'query',
                        element:<TestQuery/>
                    },
                    {
                        path:'testState',
                        element:<TestState/>
                    }
                ]
            },
            {
                path:'news',
                element:<News/>
            },
            // 二级路由配置重定向
            {
                index:true,
                element:<Navigate to='news' />
            }
        ]
    },
    {
        index:true,
        element:<Navigate to="/home" />
    }
]